package com.xiong.wuliao.util;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/11/12.
 */
public class LunBoPicJOSN {
    public static List<String> saveLunBoData(String s) {
        List<String> picLists = new ArrayList<>();
        JSONObject jsonObject = null;
        try {
            jsonObject = new JSONObject(s.trim());
            JSONObject object = jsonObject.optJSONObject("data");
            JSONArray array = object.optJSONArray("banners");
            for (int index = 0; index < array.length(); index++){
                JSONObject obj = array.optJSONObject(index);
                picLists.add(obj.getString("image_url"));
            }
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return picLists;
    }
}
